package com.xqls.dal.dao.mybatis;

import com.xqls.dal.dao.IntakeRealdataDao;
import com.xqls.dal.model.IntakeRealdata;
import com.xqls.dal.model.IntakeRealdataExample;
import com.xqls.dal.service.IntakeRealdataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class IntakeRealdataDaoImpl implements IntakeRealdataDao{
	
	@Autowired IntakeRealdataMapper mapper;
	
	public int insertIntakeRealdata(IntakeRealdata intakeRealdata){
		return mapper.insert(intakeRealdata);
	}
	public int updateIntakeRealdata(IntakeRealdata intakeRealdata){
		return mapper.updateByPrimaryKeySelective(intakeRealdata);
	}

	@Override
	public List<Map<String, Object>> selectByMap(Map<String, Object> map) {
		return mapper.selectByMap(map);
	}
	
	public List<IntakeRealdata> queryByDeviceNo(String deviceNo){
		IntakeRealdataExample example=new IntakeRealdataExample();
		example.createCriteria().andDeviceNoEqualTo(deviceNo);
		return mapper.selectByExample(example);
	}
	
	@Override
	public IntakeRealdata queryByRealdataNo(Integer realdataNo){
		return mapper.selectByPrimaryKey(realdataNo);
	}
	
	public List<Map<String, Object>> queryAll(){
		return mapper.selectAll();
	}
	
	public IntakeRealdata selectByDeviceNo(String deviceNo){
		return mapper.selectBydeviceNo(deviceNo);
	}
	@Override
	public List<IntakeRealdata> selectListByMap(Map<String, Object> map) {
		return mapper.selectListByMap(map);
	}

	@Override
	public int deleteBydeviceNo(List deviceNo) {
		return mapper.deleteBydeviceNo(deviceNo);
	}

	@Override
	public List<IntakeRealdata> selectintake() {
		return mapper.selectintake();
	}
}
